#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int x = 0;
	int y = 0;
	int m = 0;
	int n = 0;
	int i = 0;
	int arr[20];
	scanf("%d", &x);
	while (x)
	{
		arr[m++] = x % 10;
		x /= 10;
	}
	n = m;
	for (i = n - 1, m = 0; i >= 0; i--, m++)
	{
		printf("%d", arr[i]);
		if ((n - 1 - m) % 3 == 0 && m < n - 1)
		{
			printf(",");
		}
	}
	return 0;
}